package com.jk.kdd.system.service;

import com.jk.kdd.system.dao.SystemContactsCollectMapper;
import com.jk.kdd.system.model.SystemContactsCollect;
import com.jk.kdd.system.vo.SystemContactsCollectVO;
import org.smart4j.framework.base.BaseDAO;
import org.smart4j.framework.helper.BeanHelper;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * Created by DELL on 2016/10/9.
 */
//@Service
public class SystemContactsCollectServiceImpl implements  SystemContactsCollectService{

    //@Resource
    private SystemContactsCollectMapper systemContactsCollectMapper;

    /**
     * 获取实体列表
     */
    public List<SystemContactsCollectVO> getSystemContactsCollectList() {
        List<SystemContactsCollect> systemContactsCollect = BaseDAO.findEntityList(SystemContactsCollect.class);
        List<SystemContactsCollectVO> tagVOList = BeanHelper.mapList(systemContactsCollect,SystemContactsCollectVO.class);
        return tagVOList;
    }
    /**
     * 根据主键获取实体
     */
    public SystemContactsCollectVO getSystemContactsCollectByPK(SystemContactsCollect user) {
        SystemContactsCollect systemContactsCollect = BaseDAO.findEntityByPk(user);
        SystemContactsCollectVO systemContactsCollectVO = new SystemContactsCollectVO();
        BeanHelper.copyBean(systemContactsCollect,systemContactsCollectVO);
        return systemContactsCollectVO;
    }

    /**
     * 创建实体
     */
    @Transactional
    public boolean createSystemContactsCollect(SystemContactsCollect user, String operatorID) {
        return BaseDAO.insertEntity(user,operatorID);
    }

    /**
     * 更新实体
     */
    @Transactional
    public boolean modifySystemContactsCollect(SystemContactsCollect user, String operatorID) {
        return BaseDAO.updateEntity(user, operatorID);
    }

    /**
     * 删除实体
     */
    @Transactional
    public boolean removeSystemContactsCollect(SystemContactsCollect user, String operatorID) {
        return BaseDAO.deleteEntity(user, operatorID);
    }
}
